package GUIStudy.Basis.Test;

import javax.swing.*;

public class LoginGUI {
    public static void main(String[] args) {
        JFrame frame = new JFrame("用户登录");
        frame.setSize(400, 300);
        frame.setAlwaysOnTop(true);
        frame.setLayout(null);
        frame.setDefaultCloseOperation(3);

        JLabel usernameLabel = new JLabel("用户名");
        usernameLabel.setBounds(50, 50, 50 ,20);
        frame.add(usernameLabel);
        JLabel passwordLabel = new JLabel("密码");
        passwordLabel.setBounds(50,100, 50, 20);
        frame.add(passwordLabel);

        JTextField usernameField = new JTextField();
        usernameField.setBounds(150,50,180,20);
        frame.add(usernameField);
        JPasswordField passwordField = new JPasswordField();
        passwordField.setBounds(150,100,180,20);
        frame.add(passwordField);

        JButton button = new JButton("登录");
        button.setBounds(50,200,280,20);
        frame.add(button);

        frame.setVisible(true);
    }
}
